/*
 * @(#)ScriptInfo.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.core.config.runtime;

import com.nhncorp.usf.core.service.ServiceType;

/**
 * @author Web Platform Development Team
 */
public class ScriptInfo extends ServiceImpl implements Service {
    private String scriptType = "javascript"; //script type

    /**
     * script language method name
     */
    private String functionName;

    private String callType;

    private String params;

    private String returnId;

    /**
     * Instantiates a new script info.
     *
     * @param scriptType   the script type
     * @param functionName the function name
     */
    public ScriptInfo(String scriptType, String functionName) {
        this.scriptType = scriptType;
        this.functionName = functionName;
    }

    /**
     * Gets the script type.
     *
     * @return the script type
     */
    public String getScriptType() {
        return scriptType;
    }

    /**
     * Gets the function name.
     *
     * @return the function name
     */
    public String getFunctionName() {
        return functionName;
    }

    /**
     * Gets the call type.
     *
     * @return the call type
     */
    public String getCallType() {
        return callType;
    }

    /**
     * Sets the call type.
     *
     * @param callType the new call type
     */
    public void setCallType(String callType) {
        this.callType = (callType == null) ? ScriptEngineGlobals.SCRIPT_CALL_TYPE_PRE : callType;
    }

    /**
     * script information
     *
     * @return the script information(script type & function name)
     */
    public String toString() {
        return scriptType + ":" + functionName;
    }

    /**
     * Gets the params.
     *
     * @return the params
     */
    public String getParams() {
        return params;
    }

    /**
     * Sets the params.
     *
     * @param params the new params
     */
    public void setParams(String params) {
        this.params = params;
    }

    /**
     * Gets the return id.
     *
     * @return the return id
     */
    public String getReturnId() {
        return returnId;
    }

    /**
     * Sets the return id.
     *
     * @param returnId the new return id
     */
    public void setReturnId(String returnId) {
        this.returnId = returnId;
    }

    /**
	 * 사용안함
	 * 
	 * @return boolean
	 * */
	@Override
	public boolean isControlBlock() {
		return false;
	}

	/**
	 * 사용안함
	 * 
	 * @param controllable 사용안함
	 * */
	@Override
	public void setControlBlock(boolean controllable) {
	}

	@Override
	public ServiceType getServiceType() {
		return ServiceType.condition_script;
	}
}
